package com.wuercloud.utils;

import com.wuercloud.core.ResponseCode;
import com.wuercloud.error.ParamException;



public class AssertUtil {

    public static void isTrue(boolean expression, String message) {
        if (expression) {
            throw new ParamException(message);
        }
    }

    public static void isTrue(boolean expression) {
        if (expression) {
            throw new ParamException(ResponseCode.QUERY_FAILURE);
        }

    }

    public static void isNull(Object object, String message) {
        if (object != null) {
            throw new ParamException(message);
        }
    }

    public static void notNull(Object object, String message) {
        if (object == null) {
            throw new ParamException(message);
        }
    }


}
